﻿
using System;
using System.Drawing;
using System.Windows.Forms;
using DiPlaner;

namespace DiPlaner.Profile
{
    public sealed class ListTemplate : Panel
    {
        public  Button line_btn_del;
        public Button line_btn_wiz;
        public Button line_btn_stop;
        public Button line_btn_start;
        public Label line_lb_name;
        public Label line_lb_timer;
        public Label line_lb_setUnset;
        public Label line_lb_statusText;
        public CheckBox line_chb_enable;
        public CheckBox line_chb_minimize;

        private bool _active;
        public bool active
        {
            get { return _active; }
            set
            {
                _active = value;
                //Enabled = value;
            }
        }

        public int Index;
        
        #region Initialize elements

        public ListTemplate(int index)
        {
            try
            {
                line_btn_del = new Button();
                line_btn_wiz = new Button();
                line_btn_stop = new Button();
                line_btn_start = new Button();
                line_lb_name = new Label();
                line_lb_timer = new Label();
                line_lb_setUnset = new Label();
                line_lb_statusText = new Label();
                line_chb_enable = new CheckBox();
                line_chb_minimize = new CheckBox();

                Index = index;
                var stindex = string.Format("{0:00}", index);
                
                // 
                // line_btn_del
                // 
                line_btn_del.FlatStyle = FlatStyle.Popup;
                line_btn_del.Font = new Font("Arial Black", 12F, FontStyle.Bold, GraphicsUnit.World, 0);
                line_btn_del.ForeColor = Color.Red;
                line_btn_del.Location = new Point(235, -1);
                line_btn_del.Margin = new Padding(0);
                line_btn_del.Name = "line_btn_del" + stindex;
                line_btn_del.Size = new Size(22, 23);
                line_btn_del.TabIndex = 0;
                line_btn_del.TabStop = false;
                line_btn_del.Text = "X";
                line_btn_del.UseVisualStyleBackColor = true;
                // 
                // line_btn_wiz
                // 
                line_btn_wiz.FlatStyle = FlatStyle.Flat;
                line_btn_wiz.Font = new Font("Microsoft Sans Serif", 8F, FontStyle.Regular, GraphicsUnit.Point, 204);
                line_btn_wiz.Location = new Point(44, 4);
                line_btn_wiz.Name = "line_btn_wiz" + stindex;
                line_btn_wiz.Size = new Size(36, 32);
                line_btn_wiz.TabIndex = 0;
                line_btn_wiz.TabStop = false;
                line_btn_wiz.Text = "Wiz";
                line_btn_wiz.UseVisualStyleBackColor = true;
                // 
                // line_btn_stop
                // 
                line_btn_stop.FlatStyle = FlatStyle.Flat;
                line_btn_stop.Font = new Font("Microsoft Sans Serif", 10F, FontStyle.Regular, GraphicsUnit.Point, 204);
                line_btn_stop.Location = new Point(78, 4);
                line_btn_stop.Name = "line_btn_stop" + stindex;
                line_btn_stop.Size = new Size(60, 32);
                line_btn_stop.TabIndex = 0;
                line_btn_stop.TabStop = false;
                line_btn_stop.Text = "Stop";
                line_btn_stop.UseVisualStyleBackColor = true;
                // 
                // line_btn_start
                // 
                line_btn_start.FlatStyle = FlatStyle.Flat;
                line_btn_start.Font = new Font("Microsoft Sans Serif", 10F, FontStyle.Regular, GraphicsUnit.Point, 204);
                line_btn_start.Location = new Point(78, 4);
                line_btn_start.Name = "line_btn_start" + stindex;
                line_btn_start.Size = new Size(60, 32);
                line_btn_start.TabIndex = 0;
                line_btn_start.TabStop = false;
                line_btn_start.Text = "Start";
                line_btn_start.UseVisualStyleBackColor = true;
                // 
                // line_lb_name
                // 
                line_lb_name.Font = new Font("Arial", 9F, FontStyle.Bold | FontStyle.Underline, GraphicsUnit.Point, 204);
                line_lb_name.Location = new Point(138, 4);
                line_lb_name.Name = "line_lb_name" + stindex;
                line_lb_name.Size = new Size(94, 15);
                line_lb_name.TabIndex = 0;
                line_lb_name.TabStop = false;
                line_lb_name.Text = "";
                line_lb_name.TextAlign = ContentAlignment.MiddleRight;
                // 
                // line_lb_timer
                // 
                line_lb_timer.AutoSize = true;
                line_lb_timer.Font = new Font("Verdana", 10F, FontStyle.Bold, GraphicsUnit.Point, 204);
                line_lb_timer.ForeColor = Color.Red;
                line_lb_timer.Location = new Point(138, 18);
                line_lb_timer.Name = "line_lb_timer" + stindex;
                line_lb_timer.Size = new Size(96, 17);
                line_lb_timer.TabIndex = 0;
                line_lb_timer.TabStop = false;
                line_lb_timer.Text = "0:00:00:00";
                // 
                // line_lb_setUnset
                // 
                line_lb_setUnset.Font = new Font("Arial", 12F, FontStyle.Bold, GraphicsUnit.Point, 204);
                line_lb_setUnset.ForeColor = Color.Red;
                line_lb_setUnset.Location = new Point(141, 4);
                line_lb_setUnset.Name = "line_lb_setUnset" + stindex;
                line_lb_setUnset.Size = new Size(91, 32);
                line_lb_setUnset.TabIndex = 0;
                line_lb_setUnset.TabStop = false;
                line_lb_setUnset.Text = "UNSET";
                line_lb_setUnset.TextAlign = ContentAlignment.MiddleCenter;
                // 
                // line_lb_statusText
                // 
                line_lb_statusText.Font = new Font("Arial", 8F, FontStyle.Italic, GraphicsUnit.Point, 204);
                line_lb_statusText.ForeColor = Color.FromArgb(255, 78, 78, 78);
                line_lb_statusText.Location = new Point(2, 42);
                line_lb_statusText.Name = "line_lb_statusText" + stindex;
                line_lb_statusText.Size = new Size(250, 15);
                line_lb_statusText.TabIndex = 0;
                line_lb_statusText.TabStop = false;
                line_lb_statusText.Text = "Status: Not running...";
                line_lb_statusText.TextAlign = ContentAlignment.MiddleLeft;
                // 
                // line_chb_enable
                // 
                line_chb_enable.AutoSize = true;
                line_chb_enable.Font = new Font("Arial", 9F, FontStyle.Bold, GraphicsUnit.Point, 204);
                line_chb_enable.Location = new Point(2, 3);
                line_chb_enable.Name = "line_chb_enable" + stindex;
                line_chb_enable.Size = new Size(47, 19);
                line_chb_enable.TabIndex = 0;
                line_chb_enable.TabStop = false;
                line_chb_enable.Text = "#" + stindex;
                line_chb_enable.UseVisualStyleBackColor = true;
                line_chb_enable.Checked = true;
                // 
                // line_chb_minimize
                // 
                line_chb_minimize.AutoSize = true;
                line_chb_minimize.Location = new Point(2, 19);
                line_chb_minimize.Name = "line_chb_minimize" + stindex;
                line_chb_minimize.Size = new Size(42, 17);
                line_chb_minimize.TabIndex = 0;
                line_chb_minimize.TabStop = false;
                line_chb_minimize.Text = "min";
                line_chb_minimize.UseVisualStyleBackColor = true;
                line_chb_minimize.Checked = true;


                BorderStyle = BorderStyle.FixedSingle;
                Controls.Add(line_btn_del);
                Controls.Add(line_btn_wiz);
                Controls.Add(line_btn_stop);
                Controls.Add(line_btn_start);
                Controls.Add(line_lb_name);
                Controls.Add(line_lb_timer);
                Controls.Add(line_lb_setUnset);
                Controls.Add(line_lb_statusText);
                Controls.Add(line_chb_enable);
                Controls.Add(line_chb_minimize);
                Name = "line_panel" + stindex;
                Anchor = AnchorStyles.Top | AnchorStyles.Left;
                Size = new Size(256, 56);

            }
            catch { }
        }
        #endregion

    }
}
